import React from "react";
import { Radio, Spin } from "antd";

export default function SettingItem({ title, value, onChange, options, loading, style={} }) {
  return (
    <div style={style}>
      <h4>{title}</h4>
      <Radio.Group
        value={value}
        onChange={onChange}
        options={options}
        disabled={loading}
      />
      {loading && <Spin size="small" style={{ marginLeft: 8 }} />}
    </div>
  )
}
